Experiment to rebuild Diffuse using web applets.
1import type { APIRoute } from "astro";
2import { getCollection } from "astro:content";
3
4// API Route
5export const GET: APIRoute = ({ params, props, request }) => {
6 return new Response(
7 JSON.stringify(props.manifest),
8 );
9};
10
11// Generate static paths
12export async function getStaticPaths() {
13 const applets = await getCollection("applets");
14
15 return applets.map((applet) => {
16 return {
17 params: { manifest: applet.id },
18 props: { manifest: applet.data },
19 };
20 });
21}